package com.itheima.tliasmanager.aop.test;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;



@Order(888)
@Component
@Aspect
public class TimeAspect2 {

    //  通知类型     +     切入点表达式
    @Before("execution(public * com.itheima.tliasmanager.controller.DeptController.*(..))")
    public void  time(JoinPoint jp){
        String methodName = jp.getSignature().getName();
        System.out.println(methodName+"TimeAspect2，目标方法执行的结束时间："+ LocalDateTime.now());
    }
}
